<?php 
namespace app\admin\controller;

use cmf\controller\AdminBaseController;
use cmf\controller\BaseController;
use think\Db;

	class WxcommonController extends BaseController
	{

		public function index(){
				/*园区列表*/	
	
		// $where['status'] = 1;
	
		// $incubator_type = $this->request->param('incubator_type');
	
		// if ($incubator_type) {
		// 	$where['incubator_type'] = $incubator_type;
		// }

		
		// if(session('incubator_id')){
		// 	$where['incubator_id']=session('incubator_id');
		// }
		// $list=Db::name('incubator')->where($where)->order("sort ASC")->select();


	


		}



		function tip(){
			$where=array();
			$arr=array();
			$str = $this->request->param('incubator_name',''); 
			// $incubator_id = $this->request->param('incubator_id',''); 
			// if(!empty($incubator_name)){
			// 	$where['incubator_name'] = $incubator_name;
			// }else{
			// 	$where['incubator_id'] =1;
			// }
			$where['status']=1;
			// $str_array=db('customer')->where('customer_name','like','%'.$str.'%')->where($where)->limit(10)->select();
			 $str_array=db('incubator')->where('incubator_name','like','%'.$str.'%')->where($where)->limit(10)->select();
			foreach ($str_array as $key => $value) {
				$arr[$key]['incubator_id']=$value['id'];
				$arr[$key]['incubator_name']=$value['incubator_name'];
			}
			return json($arr);
		// $str1=implode(',', $arr);
		// echo $str1;  
		}























}